package com.acsior.hibernate.vo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernateLastChangeVO;

/**
 * PostmanPayment entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "postman_payments")
@GeneratorKey(tableName = "postman_payments")
public class PostmanPaymentVO extends HibernateLastChangeVO {

	private static final long serialVersionUID = -5435285305362728049L;

	@Column(name = "add_date", nullable = false, length = 23)
	private Date addDate;

	@Column(name = "client_number", nullable = false, length = 50)
	private String clientNumber;

	/** датата на последна промяна на обекта */
	@Column(name = "last_change", nullable = false, length = 23)
	private Date lastChange;

	@Column(name = "locked", nullable = false)
	private boolean locked;

	@Column(name = "obligation", nullable = false)
	private boolean obligation;

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY, mappedBy = "postmanPayment")
	private List<ObligationServiceVO> obligationServices;

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY, mappedBy = "postmanPayment")
	private List<OrderServiceVO> orderServices;

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY, mappedBy = "postmanPayment")
	private List<PaymentServiceVO> paymentServices;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "postal_service_id", nullable = false)
	private PostalServiceVO postalService;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "postman_id", nullable = false)
	private PostmanVO postman;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "region_id")
	private RegionRouteVO region;

	@Column(name = "removed", nullable = false)
	private boolean removed;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "route_id")
	private RegionRouteVO route;

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY, mappedBy = "postmanPayment")
	private List<StationCashBoxTransactionPostmanVO> stationCashBoxTransactionPostmans;

	/** default constructor */
	public PostmanPaymentVO() {
		this.paymentServices = new ArrayList<PaymentServiceVO>();
		this.obligationServices = new ArrayList<ObligationServiceVO>();
		this.stationCashBoxTransactionPostmans = new ArrayList<StationCashBoxTransactionPostmanVO>();
	}

	/** @return the addDate */
	public Date getAddDate() {
		return this.addDate;
	}

	/** @return the clientNumber */
	public String getClientNumber() {
		return this.clientNumber;
	}

	/** @see HibernateLastChangeVO#getLastChange() */
	@Override
	public Date getLastChange() {
		return this.lastChange;
	}

	/** @return the obligationServices */
	public List<ObligationServiceVO> getObligationServices() {
		return this.obligationServices;
	}

	/** @return the orderServices */
	public List<OrderServiceVO> getOrderServices() {
		return this.orderServices;
	}

	/** @return the paymentServices */
	public List<PaymentServiceVO> getPaymentServices() {
		return this.paymentServices;
	}

	/** @return the postalService */
	public PostalServiceVO getPostalService() {
		return this.postalService;
	}

	/** @return the postman */
	public PostmanVO getPostman() {
		return this.postman;
	}

	/** @return the region */
	public RegionRouteVO getRegion() {
		return this.region;
	}

	/** @return the route */
	public RegionRouteVO getRoute() {
		return this.route;
	}

	/** @return the stationCashBoxTransactionPostmans */
	public List<StationCashBoxTransactionPostmanVO> getStationCashBoxTransactionPostmans() {
		return this.stationCashBoxTransactionPostmans;
	}

	/** @return the locked */
	public boolean isLocked() {
		return this.locked;
	}

	/** @return the obligation */
	public boolean isObligation() {
		return this.obligation;
	}

	/** @return the removed */
	public boolean isRemoved() {
		return this.removed;
	}

	/** @param addDate */
	public void setAddDate(Date addDate) {
		this.addDate = addDate;
	}

	/** @param clientNumber */
	public void setClientNumber(String clientNumber) {
		this.clientNumber = clientNumber;
	}

	/** @see HibernateLastChangeVO#setLastChange(Date) */
	@Override
	public void setLastChange(Date lastChange) {
		this.lastChange = lastChange;
	}

	/** @param locked */
	public void setLocked(boolean locked) {
		this.locked = locked;
	}

	/** @param obligation */
	public void setObligation(boolean obligation) {
		this.obligation = obligation;
	}

	/** @param obligationServices */
	public void setObligationServices(List<ObligationServiceVO> obligationServices) {
		this.obligationServices = obligationServices;
	}

	/** @param orderServices */
	public void setOrderServices(List<OrderServiceVO> orderServices) {
		this.orderServices = orderServices;
	}

	/** @param paymentServices */
	public void setPaymentServices(List<PaymentServiceVO> paymentServices) {
		this.paymentServices = paymentServices;
	}

	/** @param postalService */
	public void setPostalService(PostalServiceVO postalService) {
		this.postalService = postalService;
	}

	/** @param postman */
	public void setPostman(PostmanVO postman) {
		this.postman = postman;
	}

	/** @param region */
	public void setRegion(RegionRouteVO region) {
		this.region = region;
	}

	/** @param removed */
	public void setRemoved(boolean removed) {
		this.removed = removed;
	}

	/** @param route */
	public void setRoute(RegionRouteVO route) {
		this.route = route;
	}

	/** @param stationCashBoxTransactionPostmans */
	public void setStationCashBoxTransactionPostmans(
			List<StationCashBoxTransactionPostmanVO> stationCashBoxTransactionPostmans) {
		this.stationCashBoxTransactionPostmans = stationCashBoxTransactionPostmans;
	}
}